-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solve the problem of the document field (CPF) blocking even with the empty document. #104
base: master
Are you sure you want to change the base?
Solve the problem of the document field (CPF) blocking even with the empty document. #104
Conversation
Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖 Please select which version do you want to release:
And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.
|
react/ProfileField.js
Outdated
handleChange = e => { | ||
const { field, data, onFieldUpdate } = this.props | ||
const { value } = e.target | ||
|
||
const error = data.touched ? applyValidation(field, value) : null | ||
const maskedValue = applyMask(field, value) | ||
const error = data.touched ? applyValidation(field, value) : null | ||
const maskedValue = applyMask(field, value) | ||
|
||
onFieldUpdate({ [field.name]: { ...data, value: maskedValue, error } }) | ||
} | ||
|
||
handleBlur = () => { | ||
const { field, data, onFieldUpdate } = this.props | ||
const error = applyValidation(field, data.value) | ||
onFieldUpdate({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that there is a problem with the .editorconfig. It has changed from spaces to tabs, it makes harder to understand what was the change...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has the spacing been changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@salesfelipe Correct the spacing leaving it as it was in the master. Commited
@@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | |||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | |||
|
|||
## [Unreleased] | |||
|
|||
- Added verification if the user's document is empty not only null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a changelog conflict
What is the purpose of this pull request?
Solve the problem of the document field (CPF) blocking even with the empty document.
What problem is this solving?
This pull request is for fixing a bug: When deleting the user's document, (CPF) it no longer returns null, but an empty string, with currently validating only null, so the system is blocking the document field even with the empty field. As a result, the user is unable to register the document for the first time.
How should this be manually tested?
Pass the blockDocument property in the declaration of the my-account application in the store
Link the vtex.my-account application to the tksio-549 branch in the my-account module. It is a dependency.
Link the three store / my-account / profile-form repositories and change the property value in the store. By default, the speaker is insufficient.
If you do not pass the property or pass the false value, the field allows changes.
If it is set to true and the field still has no saved value, the field will also allow editing, if the field is already saved, the field is blocked.
WS to test
https://profileform--tokstokio.myvtex.com/account/#/profile/edit
Screenshots or example usage
prop
Before
After
Types of changes